# Generated by Django 4.2.7 on 2024-04-01 13:29

import datetime
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Spr_dlj",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("dlj", models.PositiveSmallIntegerField(verbose_name="код Арена")),
                (
                    "name_dlj",
                    models.CharField(
                        blank=True, max_length=100, verbose_name="наименование"
                    ),
                ),
                ("dred", models.DateField(auto_now_add=True)),
                ("is_active", models.BooleanField(default=True)),
            ],
            options={
                "verbose_name": "Должности",
                "verbose_name_plural": "Должности",
            },
        ),
        migrations.CreateModel(
            name="Spr_lpu",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "ter",
                    models.PositiveSmallIntegerField(
                        default=0, verbose_name="код территории"
                    ),
                ),
                (
                    "lpu",
                    models.PositiveSmallIntegerField(
                        default=0, verbose_name="код подразделения"
                    ),
                ),
                (
                    "name_lpu",
                    models.CharField(
                        blank=True,
                        max_length=100,
                        verbose_name="наименование подразделения",
                    ),
                ),
                (
                    "adress",
                    models.CharField(
                        blank=True, max_length=100, verbose_name="адрес подразделения"
                    ),
                ),
                ("dred", models.DateField(auto_now_add=True)),
                ("is_active", models.BooleanField(default=True)),
            ],
            options={
                "verbose_name": "Подразделения",
                "verbose_name_plural": "Подразделения",
            },
        ),
        migrations.CreateModel(
            name="Spr_nowork",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name_nowork",
                    models.CharField(
                        blank=True, max_length=50, verbose_name="наименование"
                    ),
                ),
                ("dred", models.DateField(auto_now_add=True)),
                ("is_active", models.BooleanField(default=True)),
            ],
            options={
                "verbose_name": "Причины отсутствия на рабочем месте",
                "verbose_name_plural": "Причины отсутствия на рабочем месте",
            },
        ),
        migrations.CreateModel(
            name="Spr_opl",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "opl",
                    models.PositiveSmallIntegerField(unique=True, verbose_name="код"),
                ),
                (
                    "name_opl",
                    models.CharField(
                        blank=True, max_length=50, verbose_name="наименование"
                    ),
                ),
                ("dred", models.DateField(auto_now_add=True)),
                ("is_active", models.BooleanField(default=True)),
            ],
            options={
                "verbose_name": "Виды оплаты",
                "verbose_name_plural": "Виды оплаты",
            },
        ),
        migrations.CreateModel(
            name="Spr_otd",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("otd", models.PositiveSmallIntegerField(verbose_name="код Арена")),
                (
                    "name_otd",
                    models.CharField(
                        blank=True, max_length=100, verbose_name="наименование"
                    ),
                ),
                (
                    "name_otdkr",
                    models.CharField(
                        blank=True, max_length=80, verbose_name="краткое наименование"
                    ),
                ),
                (
                    "type_otd",
                    models.PositiveSmallIntegerField(
                        default=0, verbose_name="тип отделения"
                    ),
                ),
                ("dred", models.DateField(auto_now_add=True)),
                ("is_active", models.BooleanField(default=True)),
                (
                    "lpu",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_lpu",
                        verbose_name="подразделение",
                    ),
                ),
            ],
            options={
                "verbose_name": "Отделения",
                "verbose_name_plural": "Отделения",
            },
        ),
        migrations.CreateModel(
            name="Spr_sdl",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "sdl",
                    models.PositiveSmallIntegerField(
                        unique=True, verbose_name="код Арена"
                    ),
                ),
                (
                    "name_sdl",
                    models.CharField(
                        blank=True, max_length=100, verbose_name="наименование"
                    ),
                ),
                ("dred", models.DateField(auto_now_add=True)),
                ("is_active", models.BooleanField(default=True)),
            ],
            options={
                "verbose_name": "Статус должности",
                "verbose_name_plural": "Статус должности",
            },
        ),
        migrations.CreateModel(
            name="Spr_smena",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name_smena", models.CharField(max_length=50, verbose_name="смена")),
                ("dred", models.DateField(auto_now_add=True)),
                ("is_active", models.BooleanField(default=True)),
            ],
            options={
                "verbose_name": "Справочник смены нечетный/четный день",
                "verbose_name_plural": "Справочник смены нечетный/четный день",
            },
        ),
        migrations.CreateModel(
            name="Spr_worker",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "mpp",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(9999999),
                        ]
                    ),
                ),
                (
                    "fam",
                    models.CharField(max_length=50, verbose_name="Фамилия сотрудника"),
                ),
                ("im", models.CharField(max_length=50, verbose_name="Имя сотрудника")),
                (
                    "ot",
                    models.CharField(
                        blank=True, max_length=50, verbose_name="Отчество сотрудника"
                    ),
                ),
                (
                    "diplom",
                    models.CharField(blank=True, max_length=40, verbose_name="Диплом"),
                ),
                (
                    "snils",
                    models.CharField(blank=True, max_length=40, verbose_name="СНИЛС"),
                ),
                (
                    "telephone",
                    models.CharField(blank=True, max_length=40, verbose_name="телефон"),
                ),
                ("dred", models.DateField(default=datetime.date.today)),
                ("is_active", models.BooleanField(default=True)),
            ],
            options={
                "verbose_name": "Сотрудники учреждения",
                "verbose_name_plural": "Сотрудники учреждения",
            },
        ),
        migrations.CreateModel(
            name="Spr_worker_dlj",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("doc", models.IntegerField(verbose_name="Код из Арены")),
                (
                    "work_tip",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(1),
                            django.core.validators.MaxValueValidator(2),
                        ]
                    ),
                ),
                (
                    "stavka",
                    models.FloatField(
                        choices=[
                            (0.25, "S025"),
                            (0.5, "S050"),
                            (0.75, "S075"),
                            (1.0, "S1"),
                        ]
                    ),
                ),
                ("vid_priema", models.IntegerField(blank=True, default=0)),
                ("doc_exp", models.IntegerField(blank=True, default=0)),
                ("dred", models.DateField(default=datetime.date.today)),
                ("is_active", models.BooleanField(default=True)),
                (
                    "id_dlj",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_dlj",
                    ),
                ),
                (
                    "id_lpu",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_lpu",
                    ),
                ),
                (
                    "id_otd",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_otd",
                    ),
                ),
                (
                    "id_sdl",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_sdl",
                    ),
                ),
                (
                    "id_worker",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_worker",
                    ),
                ),
            ],
            options={
                "verbose_name": "Сотрудники учреждения по должностям",
                "verbose_name_plural": "Сотрудники учреждения по должностям",
                "ordering": ["id_worker"],
            },
        ),
        migrations.CreateModel(
            name="worker_grfo",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("work_y", models.PositiveIntegerField(verbose_name="год графика")),
                ("work_m", models.PositiveIntegerField(verbose_name="месяц графика")),
                ("dred", models.DateField(default=datetime.date.today)),
                (
                    "id_lpu",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_lpu",
                        verbose_name="подразделение",
                    ),
                ),
                (
                    "id_opl",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_opl",
                        verbose_name="вид оплаты",
                    ),
                ),
                (
                    "id_otd",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_otd",
                        verbose_name="отделение",
                    ),
                ),
                (
                    "user_edit",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="worker_grfn",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("work_tip", models.IntegerField(choices=[(1, "Osn"), (2, "Sov")])),
                ("ntime", models.FloatField()),
                ("kdays", models.PositiveIntegerField()),
                ("dred", models.DateField(default=datetime.date.today)),
                (
                    "id_dlj",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_dlj",
                    ),
                ),
                (
                    "id_worker",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_worker_dlj",
                    ),
                ),
                (
                    "id_worker_grfo",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="rasp.worker_grfo",
                    ),
                ),
                (
                    "smena",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_smena",
                    ),
                ),
                (
                    "user_edit",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="worker_grf",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("work_y", models.PositiveIntegerField()),
                (
                    "work_m",
                    models.PositiveIntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(1),
                            django.core.validators.MaxValueValidator(12),
                        ]
                    ),
                ),
                (
                    "work_d",
                    models.PositiveIntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(1),
                            django.core.validators.MaxValueValidator(31),
                        ]
                    ),
                ),
                ("work_date", models.DateField()),
                (
                    "range_times",
                    models.CharField(
                        blank=True,
                        max_length=40,
                        null=True,
                        verbose_name="интервал времени",
                    ),
                ),
                ("kol_times", models.FloatField()),
                ("dred", models.DateField(default=datetime.date.today)),
                (
                    "id_dlj",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_dlj",
                    ),
                ),
                (
                    "id_nowork",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.spr_nowork",
                    ),
                ),
                (
                    "id_worker_grfn",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="rasp.worker_grfn",
                    ),
                ),
                (
                    "id_worker_grfo",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="rasp.worker_grfo",
                    ),
                ),
                (
                    "user_edit",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
    ]
